$OpenBSD: patch-src_sysinfo_c,v 1.1 2013/05/01 21:09:23 sthen Exp $
--- src/sysinfo.c.orig	Wed May  1 21:28:15 2013
+++ src/sysinfo.c	Wed May  1 21:31:30 2013
@@ -36,6 +36,10 @@
 # include <zone.h>
 #endif
 
+#ifdef HAVE_SYSCONF
+# include <unistd.h>
+#endif
+
 void CalculateDomainName(const char *nodename, const char *dnsname, char *fqname, char *uqname, char *domain);
 
 #ifdef LINUX
@@ -2104,6 +2108,13 @@ static void GetCPUInfo()
     char buf[CF_BUFSIZE];
     int count = 0;
 
+#ifdef HAVE_SYSCONF
+    count = sysconf(_SC_NPROCESSORS_ONLN);
+    if (count == -1) {
+        CfOut(cf_verbose, "", "Unable to get cpu data\n");
+        return;
+    }
+#else
     if ((fp = fopen("/proc/stat", "r")) == NULL)
     {
         CfOut(cf_verbose, "", "Unable to find proc/cpu data\n");
@@ -2123,6 +2134,7 @@ static void GetCPUInfo()
 
     fclose(fp);
     count--;
+#endif
 
     if (count < 1)
     {
